/**
 * Created by zhujiaming on 17/5/7.
 */
//登录模块reducer
import {loginActions} from './actions';

const initalState = {
    isLogin: false,
};

export function loginReducer(state = initalState, action) {
    switch (action.type) {
        case loginActions.ACTION_LOGIN:
            // if (action.userName === 'aaa' && action.password === 'bbb') {
            //     return {
            //         ...state,
            //         isLogin: true,
            //         loginResult:0, //0表示登录成功
            //     }
            // } else {
            //     return {
            //         ...state,
            //         isLogin: false,
            //         loginResult:1,//登录失败
            //     }
            // }
            return {
                ...state,
            }
        case loginActions.ACTION_LOGIN_FAIL:
            return {
                ...state,
            };
        case loginActions.ACTION_LOGIN_SUCCESS:
            return {
                ...state,
            };
        case loginActions.ACTION_RIGEST:
            return {...state};
        default:
            return {...state};
    }
};